package com.result.demo.global.enums;

import com.result.demo.global.result.EnumInterface;

/**
 * api异常枚举
 * @author chao.z
 */

public enum ResultCode implements EnumInterface {


    // 1000业务
    SUCCESS(1000,"成功"),
    FAIL(1111,"查询失败"),



    //2000用户
    VERIFICATION_CODE_ERROR(2001,"验证码错误"),


    //3000 订单
    ORDER_CREATE_FAIL(3000,"创建订单失败"),
    ORDER_PAY_FAIL(3001,"支付失败"),

    //4000 系统
    SYSTEM_ERROR(4000, "系统异常"),
    INVALID_SIGN(4001, "无效签名"),
    API_NOT_EXIST(4002, "API方法不存在"),
    INVALID_REQUEST_ERROR(4003, "请求方式 {0} 错误 ! 请使用 {1} 方式");




    private final Integer code;

    private final String message;

    ResultCode(Integer code, String message) {
        this.code = code;
        this.message = message;
    }



    @Override
    public Integer getCode() {
        return this.code;
    }

    @Override
    public String getMessage() {
        return this.message;
    }
}
